CKEDITOR.replace('remark', {
    "filebrowserUploadUrl" : "/study/lightbox/upload"
});

function getContenet(){
    return CKEDITOR.instances.remark.getData();    //获取textarea的值
}

$(function(){
    $("#submit").click(function(){
        var picUrl= $("#picUrl").val();
        var remark = getContenet();
        console.log(remark);
        $.post("http://localhost:8081/study/lightbox/save",{
            picUrl:picUrl,
            remark:remark
        },function(data){
            if(data.success){
                alert(data.message)
                window.location.href="html/pictureShow.html?id=0";
            }else{
                alert(data.message)
            }
        })
    })


    //禁用form表单自定义action提交功能
    $(document).ready(function(){
        $("form").submit(function(e){
            e.preventDefault();
            console.log("Submit prevented");
        });
    });
})


